<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    <title>MapReduce | 尼古拉斯-鱼丸博客 | 喝酒、吃肉、不赌</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="MapReduce">
    <meta name="description" content="MongoDB分布并行计算mapReduce什么是MapReduce?  MapReduce从字面上来理解就是两个过程：map映射以及reduce化简。是一种比较先进的大数据处理方法，其难度不高，从性能上来说属于比较暴力的（通过N台服务器同时来计算） 但相较于group以及aggregate来说，功能更强大，并更加灵活。  Map:先把某一类数据分组归类,这里的映射过程是支持分布式的,一边遍历每一">
<meta name="keywords" content="MapReduce">
<meta property="og:type" content="article">
<meta property="og:title" content="MapReduce">
<meta property="og:url" content="http://fish_08.oschina.io/2017/06/26/mapreduce/index.html">
<meta property="og:site_name" content="尼古拉斯-鱼丸博客">
<meta property="og:description" content="MongoDB分布并行计算mapReduce什么是MapReduce?  MapReduce从字面上来理解就是两个过程：map映射以及reduce化简。是一种比较先进的大数据处理方法，其难度不高，从性能上来说属于比较暴力的（通过N台服务器同时来计算） 但相较于group以及aggregate来说，功能更强大，并更加灵活。  Map:先把某一类数据分组归类,这里的映射过程是支持分布式的,一边遍历每一">
<meta property="og:updated_time" content="2017-06-28T08:16:51.541Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="MapReduce">
<meta name="twitter:description" content="MongoDB分布并行计算mapReduce什么是MapReduce?  MapReduce从字面上来理解就是两个过程：map映射以及reduce化简。是一种比较先进的大数据处理方法，其难度不高，从性能上来说属于比较暴力的（通过N台服务器同时来计算） 但相较于group以及aggregate来说，功能更强大，并更加灵活。  Map:先把某一类数据分组归类,这里的映射过程是支持分布式的,一边遍历每一">
    
        <link rel="alternative" href="/atom.xml" title="尼古拉斯-鱼丸博客" type="application/atom+xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="/css/style.css?v=1.6.7">
    <script>window.lazyScripts=[]</script>
</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">于亮</h5>
          <a href="mailto:136214289@qq.com" title="136214289@qq.com" class="mail">136214289@qq.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                文档
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://git.oschina.net/fish_08" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://weibo.com/2837335591/profile?rightmod=1&wvr=6&mod=personinfo" target="_blank" >
                <i class="icon icon-lg icon-weibo"></i>
                Weibo
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/custom"  >
                <i class="icon icon-lg icon-link"></i>
                测试
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">MapReduce</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">MapReduce</h1>
        <h5 class="subtitle">
            
                <time datetime="2017-06-26T06:22:12.000Z" itemprop="datePublished" class="page-time">
  2017-06-26
</time>


            
        </h5>
    </div>

    

</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#MongoDB分布并行计算mapReduce"><span class="post-toc-number">1.</span> <span class="post-toc-text">MongoDB分布并行计算mapReduce</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#什么是MapReduce"><span class="post-toc-number">1.1.</span> <span class="post-toc-text">什么是MapReduce?</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#什么是MapReduce工作过程"><span class="post-toc-number">1.2.</span> <span class="post-toc-text">什么是MapReduce工作过程</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#Java中执行MapReduce"><span class="post-toc-number">1.3.</span> <span class="post-toc-text">Java中执行MapReduce</span></a></li></ol></li></ol>
        </nav>
    </aside>
    
<article id="post-mapreduce"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">MapReduce</h1>
        <div class="post-meta">
            <time class="post-time" title="2017年06月26日 14:22" datetime="2017-06-26T06:22:12.000Z"  itemprop="datePublished">2017-06-26</time>

            


            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


            

        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <h2 id="MongoDB分布并行计算mapReduce"><a href="#MongoDB分布并行计算mapReduce" class="headerlink" title="MongoDB分布并行计算mapReduce"></a>MongoDB分布并行计算mapReduce</h2><h3 id="什么是MapReduce"><a href="#什么是MapReduce" class="headerlink" title="什么是MapReduce?"></a>什么是MapReduce?</h3><p>  MapReduce从字面上来理解就是两个过程：map映射以及reduce化简。是一种比较先进的大数据处理方法，其难度不高，从性能上来说属于比较暴力的（通过N台服务器同时来计算） 但相较于group以及aggregate来说，功能更强大，并更加灵活。<br>  Map:先把某一类数据分组归类,这里的映射过程是支持分布式的,一边遍历每一台服务器,一边进行分类。<br>  Reduce:然后再在分组中进行运算，这里的化简过程也是支持分布式的，在分类的过程中直接运算了。也就是说如果是一个求和的过程，先在a服务器分组求和，然后再在b服务器分组求和····最后再把化简以后的数据进行最终处理。在映射化简的过程都是每台服务器自己的CPU在运算，大量的服务器同时来进行运算工作，这就是大数据基本理念。<br>  Mongodb中提供了2种对大数据计算的方式：aggregate和mapreduce，严格意义上说mapreduce也是一种“aggregation”算法，只是这两种方式使用起来差距甚远，设计理念也不同。<br>  mapreduce有2个阶段：map和reduce；mapper处理每个document，然后emits一个或者多个objects，object为key-value对；reduce将map操作的结果进行联合操作（combine）。此外mapreduce还可以有一个finalize阶段，这是可选的，它可以调整reduce计算的结果。在进行mapreduce之前，mongodb支持使用query来筛选文档，也支持sort排序和limit。<br>  mapreduce使用javascript语法编写。</p>
  <figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line">db.runCommand(  </div><div class="line">&#123;  </div><div class="line"> mapreduce : &lt;collection&gt;,  </div><div class="line"> map : &lt;mapfunction&gt;,  </div><div class="line"> reduce : &lt;reducefunction&gt;  </div><div class="line"> [, query : &lt;query filter object&gt;]  </div><div class="line"> [, sort : &lt;sort the query.  useful   optimization&gt;] <span class="keyword">for</span>  </div><div class="line"> [, <span class="built_in">limit</span> : &lt;number of objects to   from collection&gt;] <span class="built_in">return</span>  </div><div class="line"> [, out : &lt;output-collection name&gt;]  </div><div class="line"> [, keeptemp: &lt; | &gt;] <span class="literal">true</span> <span class="literal">false</span>  </div><div class="line"> [, finalize : &lt;finalizefunction&gt;]  </div><div class="line"> [, scope : &lt;object <span class="built_in">where</span> fields go into javascript global scope &gt;]  </div><div class="line"> [, verbose :  ] <span class="literal">true</span>  </div><div class="line"> &#125;);</div></pre></td></tr></table></figure>
<p>  参数说明:<br>   mapreduce: 要操作的目标集合。<br>   map: 映射函数 (生成键值对序列，作为 reduce 函数参数)。<br>   reduce: 统计函数。<br>   query: 目标记录过滤。<br>   sort: 目标记录排序。<br>   limit: 限制目标记录数量。<br>   out: 统计结果存放集合 (不指定则使用临时集合，在客户端断开后自动删除)。<br>   keeptemp: 是否保留临时集合。<br>   finalize: 最终处理函数 (对 reduce 返回结果进行最终整理后存入结果集合)。<br>   scope: 向 map、reduce、finalize 导入外部变量。<br>   verbose: 显示详细的时间统计信息</p>
<h3 id="什么是MapReduce工作过程"><a href="#什么是MapReduce工作过程" class="headerlink" title="什么是MapReduce工作过程"></a>什么是MapReduce工作过程</h3><pre><code>原理:[摘自](http://shift-alt-ctrl.iteye.com/blog/2260684)
1）mongos接收到mapreduce的操作请求后，根据query条件，将map-reduce任务发给持有数据的shards（sharding collection将会被分裂成多个chunks并分布在多个shards中，shard即为mongod节点）。
2）每个shards都依次执行mapper和reducer，并将结果写入到本地的临时collection中，结果数据是根据_id（即reducer的key）正序排列。
3）当所有的shards都reduce完成之后，将各自结果数据中_id的最大值和最小值（即min、max key）返回给mongos。
4）mongos负责shuffle和partition，将所有shards反馈的min、max key进行汇总，并将整个key区间分成多个partitions，每个partition包含[min,max]区间，此后mongos将partiton信息封装在finalReduce指令中并发给每个shard，最终每个shard都会收到一个特定的partition的任务；partition不会重叠。
5）此后每个shard将与其他所有的shards建立链接，根据partition信息，从min到max，遍历每个key。对于任何一个key，当前shard都将从其他shards获取此key的所有数据，然后后执行reduce和finalize方法，每个key可能会执行多次reduce，这取决于values的条数，但是finalize只会执行一次，最终将此key的finalize的结果通过本地方式写入sharding collection中。
6）当所有的shards都处理完毕后，mongos将处理结果返回给客户端（inline）。

在mapper时，mapper的结果首先放在内存中，当内存的数据量达到阀值会将执行一次reduce并写入临时文件。
</code></pre><p>   在mongodb2.0版本中，finalReduce步骤将有mongos执行，即所有的shards执行完mapreduce之后，由mongos负责读取所有shards的结果并在本地进行merge和sort，然后执行finalReduce和finalize过程，这中方式并不会带来太大问题，消耗内存也小，但是会增加mongos的负担，影响应用数据的并发能力。经过2.4版本改进后（上述），性能得到很大的提高。<br>   在mapreduce执行过程中，将会阻止balancer“迁移”chunks（sharding balancer机制）；对于输出结果是sharding collection，在finalReduce期间，其chunks也不会被迁移，直到运行结束。主要是为了避免并发操作带来的问题。</p>
<h3 id="Java中执行MapReduce"><a href="#Java中执行MapReduce" class="headerlink" title="Java中执行MapReduce"></a>Java中执行MapReduce</h3><p>1.整合SpringBoot+MongoDB(<a href="http://fish_08.oschina.io/2017/06/20/mongodb/">http://fish_08.oschina.io/2017/06/20/mongodb/</a>)<br>2.插入测试数据到MongoDB的集合test中<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">&#123; <span class="string">"_id"</span> : ObjectId(<span class="string">"4e5ff893c0277826074ec533"</span>), <span class="string">"x"</span> : [ <span class="string">"a"</span>, <span class="string">"b"</span> ] &#125;</div><div class="line">&#123; <span class="string">"_id"</span> : ObjectId(<span class="string">"4e5ff893c0277826074ec534"</span>), <span class="string">"x"</span> : [ <span class="string">"b"</span>, <span class="string">"c"</span> ] &#125;</div><div class="line">&#123; <span class="string">"_id"</span> : ObjectId(<span class="string">"4e5ff893c0277826074ec535"</span>), <span class="string">"x"</span> : [ <span class="string">"c"</span>, <span class="string">"d"</span> ] &#125;</div></pre></td></tr></table></figure></p>
<p>3.根路径下新建map.js,编写map函数<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="title">function</span></span> () &#123;</div><div class="line">  <span class="keyword">for</span> (var i = 0; i &lt; this.x.length; i++) &#123;</div><div class="line">  emit(this.x[i], 1);</div><div class="line">  &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>4.根路径下新建reduce.js,编写reduce函数<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">function</span> (key, values) &#123;</div><div class="line"> var sum = 0;</div><div class="line"> <span class="keyword">for</span> (var i = 0; i &lt; values.length; i++)</div><div class="line">   sum += values[i];</div><div class="line">   <span class="built_in">return</span> sum;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>5.新建结果接收类ValueObject<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div></pre></td><td class="code"><pre><div class="line">public class ValueObject &#123;</div><div class="line"></div><div class="line">  private String id;</div><div class="line">  private <span class="built_in">float</span> value;</div><div class="line"></div><div class="line">  public String <span class="function"><span class="title">getId</span></span>() &#123;</div><div class="line">    <span class="built_in">return</span> id;</div><div class="line">  &#125;</div><div class="line"></div><div class="line">  public <span class="built_in">float</span> <span class="function"><span class="title">getValue</span></span>() &#123;</div><div class="line">    <span class="built_in">return</span> value;</div><div class="line">  &#125;</div><div class="line"></div><div class="line">  public void setValue(<span class="built_in">float</span> value) &#123;</div><div class="line">    this.value = value;</div><div class="line">  &#125;</div><div class="line"></div><div class="line">  @Override</div><div class="line">  public String <span class="function"><span class="title">toString</span></span>() &#123;</div><div class="line">    <span class="built_in">return</span> <span class="string">"ValueObject [id="</span> + id + <span class="string">", value="</span> + value + <span class="string">"]"</span>;</div><div class="line">  &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>6.测试TestMain.java<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line">@Autowired</div><div class="line">MongoOperations mongoOperations;</div><div class="line">@Test</div><div class="line">public  void   <span class="function"><span class="title">mapReduce</span></span>()&#123;</div><div class="line">//<span class="built_in">test</span> 集合名称</div><div class="line">MapReduceResults&lt;ValueObject&gt; results = mongoOperations.mapReduce(<span class="string">"test"</span>, <span class="string">"classpath:map.js"</span>, <span class="string">"classpath:reduce.js"</span>, ValueObject.class);</div><div class="line"><span class="keyword">for</span> (ValueObject  valueObject : results) &#123;</div><div class="line">    System.out.println(valueObject);</div><div class="line">&#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>7.结果</p>
<pre><code class="bash">ValueObject [id=a, value=1.0]
ValueObject [id=b, value=2.0]
ValueObject [id=c, value=2.0]
ValueObject [id=d, value=1.0]
</code></pre>
<p>默认情况下，使用INLINE的输出类型，因此您不必指定输出集合。要指定附加的map-reduce选项，请使用重载方法，该方法需要一个附加的MapReduceOptions参数。该类MapReduceOptions具有流畅的API，因此添加其他选项可以以非常紧凑的语法完成。这里是一个将输出集合设置为“jmr1_out”的示例。请注意，仅设置输出集合将采用REPLACE的默认输出类型。</p>
<pre><code class="bash">MapReduceResults&lt;ValueObject&gt; results = 
        mongoOperations.mapReduce(<span class="string">"jmr1"</span>, <span class="string">"classpath:map.js"</span>, <span class="string">"classpath:reduce.js"</span>,
                new MapReduceOptions().outputCollection(<span class="string">"jmr1_out"</span>), ValueObject.class);
</code></pre>
<p>还有一个静态导入import static org.springframework.data.mongodb.core.mapreduce.MapReduceOptions.options;可以用来使语法稍微更紧凑</p>
<pre><code class="bash">MapReduceResults&lt;ValueObject&gt; results = 
        mongoOperations.mapReduce(<span class="string">"jmr1"</span>, <span class="string">"classpath:map.js"</span>, <span class="string">"classpath:reduce.js"</span>,
                options().outputCollection(<span class="string">"jmr1_out"</span>), ValueObject.class);
</code></pre>
<p>您还可以指定一个查询，以减少将用于进入map-reduce操作的数据集。这将从map-reduce操作的考虑中删除包含[a，b]的文档。</p>
<pre><code class="bash">Query query = new Query(<span class="built_in">where</span>(<span class="string">"x"</span>).ne(new String[] { <span class="string">"a"</span>, <span class="string">"b"</span> }));
MapReduceResults&lt;ValueObject&gt; results = 
        mongoOperations.mapReduce(query, <span class="string">"jmr1"</span>, <span class="string">"classpath:map.js"</span>, <span class="string">"classpath:reduce.js"</span>,
                options().outputCollection(<span class="string">"jmr1_out"</span>), ValueObject.class);
</code></pre>
<p>请注意，您可以在查询上指定其他限制和排序值，但不能跳过值。</p>

        </div>

        <blockquote class="post-copyright">
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2017-06-28T08:16:51.541Z" itemprop="dateUpdated">2017年6月28日 16:16</time>
</span><br>


        如要转载请注明出处：<a href="/2017/06/26/mapreduce/" target="_blank" rel="external">http://fish_08.oschina.io/2017/06/26/mapreduce/</a>
    </div>
    <footer>
        <a href="http://fish_08.oschina.io">
            <img src="/img/avatar.jpg" alt="于亮">
            于亮
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/MapReduce/">MapReduce</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://fish_08.oschina.io/2017/06/26/mapreduce/&title=《MapReduce》 — 尼古拉斯-鱼丸博客&pic=http://fish_08.oschina.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://fish_08.oschina.io/2017/06/26/mapreduce/&title=《MapReduce》 — 尼古拉斯-鱼丸博客&source=" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://fish_08.oschina.io/2017/06/26/mapreduce/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《MapReduce》 — 尼古拉斯-鱼丸博客&url=http://fish_08.oschina.io/2017/06/26/mapreduce/&via=http://fish_08.oschina.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://fish_08.oschina.io/2017/06/26/mapreduce/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2017/06/28/hello-world/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">Hello World</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2017/06/23/QRcode/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">zxing后台二维码生成和解析类库</h4>
      </a>
    </div>
  
</nav>



    







</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢包子~
        <i class="icon icon-quote-right"></i>
    </h3>
    <ul class="reward-items">
        
        <li>
            <img src="/img/wechat.png" title="微信打赏二维码" alt="微信打赏二维码">
            <p>微信</p>
        </li>
        

        
        <li>
            <img src="/img/alipay.png" title="支付宝打赏二维码" alt="支付宝打赏二维码">
            <p>支付宝</p>
        </li>
        
    </ul>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            <span>博客内容遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">知识共享 署名 - 非商业性 - 相同方式共享 4.0协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p>
            <span>Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="http://fish_08.oschina.io/" target="_blank">yuliang</a></span>
            <span>尼古拉斯-鱼丸博客 &copy; 2015 - 2018</span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://fish_08.oschina.io/2017/06/26/mapreduce/&title=《MapReduce》 — 尼古拉斯-鱼丸博客&pic=http://fish_08.oschina.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://fish_08.oschina.io/2017/06/26/mapreduce/&title=《MapReduce》 — 尼古拉斯-鱼丸博客&source=" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://fish_08.oschina.io/2017/06/26/mapreduce/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《MapReduce》 — 尼古拉斯-鱼丸博客&url=http://fish_08.oschina.io/2017/06/26/mapreduce/&via=http://fish_08.oschina.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://fish_08.oschina.io/2017/06/26/mapreduce/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };



</script>

<script src="/js/main.min.js?v=1.6.7"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="/js/search.min.js?v=1.6.7" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>


</body>
</html>
